Setting Choices for Multi-State Buttons

Description

A data field displayed as a multi-state button accepts only values that are in its choice list.

  1. Select the control, choose Object > Properties and display the Setup tab.

  2. Select "List Box" or "Combo Box" in the Field-Type list.

  3. Display the Choices tab.

  4. Select the display style. The options are:

    • " User Defined "

    • " Populated Using Xbasic "

  5. User Defined

    If you selected "User Defined" in step 4:

    • 1. Enter choices one per line. Refer to Specifying User Defined Choices.

    • 2. Optionally, click the 'AZ up arrow' icon or the 'ZA down arrow' icon to sort the entries in ascending or descending order.

  6. Populated Using Xbasic

    If you selected "Populated Using Xbasic" in step 4:

    • Click OK to save your property settings.

    • Right click on the form and select Events > OnInit.

    • In the Create new Event Script dialog select Create using Xbasic and click OK.

    • In the Create new Event Script dialog select Create using Xbasic and click OK.

    • Enter Xbasic code structured as follows. Substitute your control's name for .

    • Optionally, substitute your list of choices, one per line, for:

      ...
      DIM pObj as P
      pObj = topparent:.this
      pObj.settings.dynamic_list = <<%str%
      
      
      ...
      
      %str%
    • Optionally, substitute a call to a function that returns a CR-LF delimited list for:

      <<%str% 
      
      
      ... 
      
      %str%
      DIM pObj as P
      pObj = topparent:.this
      pObj.settings.dynamic_list = MyFunction()

See Also